# gateway="192.168.22.1"
config_file_path="/etc/netplan/00-installer-config.yaml"
new_ip=$1
echo "network:" > $config_file_path
echo "  ethernets:" >> $config_file_path
echo "    ens33:" >> $config_file_path
echo "      addresses:" >> $config_file_path
echo "      - $new_ip/24" >> $config_file_path
echo "      gateway4: $gateway" >> $config_file_path
echo "      nameservers:" >> $config_file_path
echo "        addresses: []" >> $config_file_path
echo "        search: []" >> $config_file_path
echo "  version: 2" >> $config_file_path
netplan apply